
// 3DModelViewerView.h : interface of the CMy3DModelViewerView class
//

#pragma once


class CMy3DModelViewerView : public CView
{
protected: // create from serialization only
	CMy3DModelViewerView();
	DECLARE_DYNCREATE(CMy3DModelViewerView)

// Attributes
public:
	CMy3DModelViewerDoc* GetDocument() const;

// Operations
public:

// Overrides
public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// Implementation
public:
	virtual ~CMy3DModelViewerView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	afx_msg void OnFilePrintPreview();
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);

private:
	BOOL InitializeOpenGL();
	BOOL SetupPixelFormat();
	void RenderScene();
private:
	HGLRC	m_hRC;		//Rendering Context
	CDC*	m_pDC;		//Device Context

};

#ifndef _DEBUG  // debug version in 3DModelViewerView.cpp
inline CMy3DModelViewerDoc* CMy3DModelViewerView::GetDocument() const
   { return reinterpret_cast<CMy3DModelViewerDoc*>(m_pDocument); }
#endif

